package com.me.bean;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

public class Xt implements Parcelable {

    public long id;

    public long time;

    public int type;

    public float value;

    public Xt() {

    }

    protected Xt(Parcel in) {
        id = in.readLong();
        time = in.readLong();
        type = in.readInt();
        value = in.readFloat();
    }

    public static final Creator<Xt> CREATOR = new Creator<Xt>() {
        @Override
        public Xt createFromParcel(Parcel in) {
            return new Xt(in);
        }

        @Override
        public Xt[] newArray(int size) {
            return new Xt[size];
        }
    };

    public String getTypeString() {
        switch (type) {
            case 1:
                return "午饭前";
            case 2:
                return "午饭后";
            case 3:
                return "晚饭前";
            default:
                return "随机";
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel parcel, int i) {
        parcel.writeLong(id);
        parcel.writeLong(time);
        parcel.writeInt(type);
        parcel.writeFloat(value);
    }
}
